#include <stdlib.h>
#include <time.h>
#include <stdio.h>
int main()
{
    /*定义数组存入1~5*/
    int arr[5] = {1, 2, 3, 4, 5};
    int len = sizeof(arr) / sizeof(int);
    /*定义随机数种子*/
    srand(time(NULL));
    for (int i = 0; i < len; i++)
    {
        /*取随机数*/
        int index = rand() % 5;
        int a = arr[i];
        arr[i] = arr[index];
        arr[index] = arr[i];
    }
    for (int i = 0; i < len; i++)
    {
        printf("%d ", arr[i]);
        /* code */
    }
}